// Made by Peter "Stickman" Muller

#include "StdAfx.h"
#include <fstream>
#include <string>
#include <iostream>

using namespace std;

int main()
{
    int num;                // Number of Waves
    int max;                // Last Wave #
    int off;                // Address of Wave0
    string space;

    cout << "Stickman's Offset Maker" << endl;
    cout << endl;
    cout << "Enter the last Wave #" << endl;
    cin >> max;
    cout << endl;
    cout << "Enter the FIX offset of Wave0" << endl;
    cin >> hex >> off;
    cout << endl;

    ofstream file("offsets.txt");
    file << "              List of Offsets" << endl;
    file << endl;
	file << "              Frequency Offset    Fix Offset" << endl;
    for (num = 0; num <= max; num++)
    {

        if (num < 10)
        {
            space = "         ";
        }
        else if (num < 100)
        {
            space = "        ";
        }
        else
        {
            space = "       ";
        }

			
            file << "Wave" << dec << num << space << hex << uppercase << num * 108 + off - 56 << "              " << hex << uppercase << num * 108 + off << endl;
			cout << "Wave" << dec << num << space << hex << uppercase << num * 108 + off - 56 << "              " << hex << uppercase << num * 108 + off << endl;
    }
    file << endl;
    file << "This list was generated by Stickman's Offset Maker. For more information, check out his blog at http://stickman221.wordpress.com" << endl << "Enjoy!" << endl;
    file.close();

    cout << "offsets.txt created!" << endl;

    return 0;
}